<template>
    <BaseTable :columns="columns" :data="list" max-height="300px" highlight-current-row empty-text="暂无数据~">
    </BaseTable>
</template>

<script>
const locationTypes = {
    1: '设施',
    2: '桩号',
    3: '桩号范围',
    4: '机电设备'
}
const columns = [
    {
        attrs: {
            label: '序号',
            prop: 'index',
            width: '130',
            'show-overflow-tooltip': true
        }
    },
    {
        attrs: {
            label: '方向',
            prop: 'directionName',
            width: '130',
            'show-overflow-tooltip': true
        }
    },
    {
        attrs: {
            label: '位置类型',
            prop: 'locationType',
            formatter: (r, c, val) => {
                if (locationTypes[val]) {
                    return locationTypes[val]
                }
                return val
            },
            width: '130',
            'show-overflow-tooltip': true
        }
    },
    {
        attrs: {
            label: '位置/桩号',
            prop: 'location',
            width: '130',
            'show-overflow-tooltip': true
        }
    },
    {
        attrs: {
            label: '上报类型',
            prop: 'type',
            'show-overflow-tooltip': true,
            'min-width': '140'
        }
    },
    {
        attrs: {
            label: '事件/问题描述',
            prop: 'description',
            'show-overflow-tooltip': true,
            'min-width': '140'
        }
    },
    // {
    //     attrs: {
    //         label: '单位',
    //         'show-overflow-tooltip': true,
    //         prop: 'unit',
    //         'min-width': '120'
    //     }
    // },
    // {
    //     attrs: {
    //         label: '数量',
    //         prop: 'num',
    //         'show-overflow-tooltip': true,
    //         'min-width': '100'
    //     }
    // },
    {
        attrs: {
            label: '处置结果33',
            prop: 'disposalResults',
            'show-overflow-tooltip': true,
            'min-width': '100'
        }
    }
]
export default {
    name: 'DefectTable',
    props: {
        list: {
            type: Array,
            default: () => []
        },
        columns: {
            type: Array,
            default: () => columns
        }
    },
    data() {
        return {
        }
    },
    methods: {}
}
</script>

<style lang="scss" scoped>
</style>
